![]() |
DragControl |
||||
Header: | Controls.h | Carbon status: | Supported | |
Draws and moves an outline of a control or its indicator while the user drags it.
void DragControl ( ControlRef theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis );
A handle to the control to drag.
The location of the cursor at the time the mouse button was first pressed, in global coordinates. Your application retrieves this point from the where field of the event structure.
A pointer to a rectangle—whose coordinates should normally coincide with or be contained in the window’s content region—delimiting the area in which the user can drag the control’s outline.
A pointer to a rectangle that allows some extra space for the user to move the mouse while still constraining the control within the rectangle specified in the limitRect parameter.
The axis along which the user may drag the control’s outline. Specify the axis using one of the following values: noConstraint (no constraint), hAxisOnly (drag along horizontal axis only), vAxisOnly (drag along vertical axis only).
The DragControl function moves a dotted outline of a control, such as a scroll box, around the screen, following the movements of the cursor until the user releases the mouse button. When the user releases the mouse button, DragControl moves the control to the new location.
The function TrackControl automatically calls the DragControl function as appropriate; when you use TrackControl, you don’t need to call DragControl.
Before tracking the cursor, DragControl calls the control definition function. If you define your own control definition function, you can specify custom dragging behavior.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)